

from util.selenium.webdriver.common.by import By

from base.BaseMethod import BM


class IAMgtTech():
    form_btn_loc = (By.LINK_TEXT, '管理与科技人员情况')
    mgt_tech_loc = (By.CSS_SELECTOR, 'textarea#Glykj')
    save_btn_loc = (By.CSS_SELECTOR, 'button#dataEprCycxSave')


    def __init__(self, driver=None, text=''):

        self.driver = driver
        self.text = text
    @property
    def class_name(self):
        return self.__class__.__name__

    def fill_form(self):
        BM.click(driver=self.driver, ele_loc=self.form_btn_loc)
        BM.wait(driver=self.driver, ele_loc=self.mgt_tech_loc)
        BM.input(driver=self.driver, ele_loc=self.mgt_tech_loc, keys=self.text)
        BM.global_click_btn(btn_loc=self.save_btn_loc, driver=self.driver)
